<template>
    <div class="header_item">
        <el-tooltip placement="bottom" effect="dark" :content="fullScreen?'退出全屏':'全屏'">
        <svg class="iconpark-icon" @click="handleScreen">
            <use :href="fullScreen?'#off-screen':'#full-screen'"></use>
        </svg>
        </el-tooltip>
    </div>
</template>

<script>
import {mapGetters} from "vuex";
import {fullscreenToggel, listenfullscreen} from "@/util/util.js";

export default {
    computed: mapGetters(["fullScreen"]),
    mounted() {
        listenfullscreen(() => {
            this.$store.dispatch("UpdateFullScreen")
        });
    },
    methods: {
        handleScreen() {
            fullscreenToggel();
        }
    }
};
</script>